<!doctype html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Populating a combo box from the server</title>

	<script src="../../codebase/dhtmlxscheduler.js?v=5.2.1" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler_material.css?v=5.2.1" type="text/css" charset="utf-8">
	<script src="../../codebase/ext/dhtmlxscheduler_editors.js?v=5.2.1" type="text/javascript" charset="utf-8"></script>

	<script src="//cdn.dhtmlx.com/edge/dhtmlx.js?v=5.2.1" type="text/javascript"></script>
	<link rel="stylesheet" href="//cdn.dhtmlx.com/edge/dhtmlx.css?v=5.2.1" type="text/css"> 

	<style type="text/css" >
		html, body {
			margin: 0px;
			padding: 0px;
			height: 100%;
			overflow: hidden;
		}
	</style>

	<script type="text/javascript" charset="utf-8">
		function init() {
			scheduler.config.multi_day = true;

			scheduler.config.event_duration = 30;
			scheduler.config.auto_end_date = true;
			scheduler.config.details_on_create = true;
			scheduler.config.details_on_dblclick = true;

			scheduler.locale.labels.section_country = "Select country:";

			var snacks = [
				{ key: 5, label: 'Pineapple' },
				{ key: 6, label: 'Chocolate' },
				{ key: 7, label: 'Chips' },
				{ key: 8, label: 'Apple pie' }
			];

			scheduler.config.lightbox.sections = [
				{ name: "description", height: 50, map_to: "text", type: "textarea", focus: true },
				{ name: "country", options: snacks, map_to: "combo_select", type: "combo", image_path: "//cdn.dhtmlx.com/edge/imgs/", filtering: true, 
				script_path: "/scheduler/backend/countries", cache: false },
				{ name: "time", height: 72, type: "time", map_to: "auto"}
			];

			scheduler.init('scheduler_here', new Date(2019, 3, 3), "week");

			scheduler.parse([
				{ start_date: "2019-04-03 06:00", end_date: "2019-04-03 15:00", text: "Task A-12458", combo_select: 5 },
				{ start_date: "2019-04-04 05:00", end_date: "2019-04-04 11:00", text: "Task A-89411", combo_select: 105 }
			]);

			dhtmlx.message({
			    text:"This example uses dhtmlxCombo which can be used under GPLv2 license or has to be obtained separately. <br><br> You can do this or use a third-party combobox widget instead.",
			    expire:1000*30
			});

		}
	</script>

</head>

<body onload="init();">
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
	<div class="dhx_cal_navline">
		<div class="dhx_cal_prev_button">&nbsp;</div>
		<div class="dhx_cal_next_button">&nbsp;</div>
		<div class="dhx_cal_today_button"></div>
		<div class="dhx_cal_date"></div>
		<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
		<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
		<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
	</div>
	<div class="dhx_cal_header">
	</div>
	<div class="dhx_cal_data">
	</div>
</div>
</body>